package com.cjk.foundation.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.cjk.foundation.entity.AppVersionEntity;

@Repository
public interface AppVersionDao {
	
	@Insert("insert into app_version(sn, launcher_version, movie_version, live_version) values(#{sn}, #{launcherVersion}, #{movieVersion}, #{liveVersion}) on duplicate key update launcher_version = values(launcher_version), movie_version = values(movie_version), live_version = values(live_version)")
	public void updateVersion(@Param("sn") String sn, @Param("launcherVersion") String launcherVersion, @Param("movieVersion") String movieVersion, @Param("liveVersion") String liveVersion);
	
	@ResultMap("resultMap")
	@Select("select * from app_version where sn = #{sn}")
	public AppVersionEntity selectBySn(@Param("sn") String sn);
	
}
